//
//  CircleBottomCommentView.m
//  GLGW_Shoping
//
//  Created by whx on 2018/12/1.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "CircleBottomCommentView.h"

@interface CircleBottomCommentView()<UIGestureRecognizerDelegate>
{
    GLGWLabel *leftCommentsLab;
    GLGWLabel *middleLikeLab;
    GLGWLabel *rightShareLab;
}

@end

@implementation CircleBottomCommentView

- (id)initWithFrame:(CGRect)aFrame inSuperView:(UIView *)aSuperView
{
    if (self = [super initWithFrame:aFrame inSuperView:aSuperView]) {
        CGFloat widthS = (aFrame.size.width)/3;
        leftCommentsLab = [[GLGWLabel alloc] initWithFrame:CGRectMake(0, 0, widthS, kHeightProportion_In_iPhoneTriploid(48)) theFont:SYSTEMFONT(14) theColor:[UIColor colorWithHexString:@"#666666"] inSuperView:self];
        leftCommentsLab.attributedText = [GLGWLabel addImageName:@"home_Shape" theImageFram:CGRectMake(0, -3, kWidthProportion_In_iPhoneTriploid(14), kHeightProportion_In_iPhoneTriploid(14)) theTextString:@" 30" atImageIndex:0];

        middleLikeLab = [[GLGWLabel alloc] initWithFrame:CGRectMake((widthS * 3 - 2 * widthS), 0, widthS, CGRectGetHeight(leftCommentsLab.frame)) theFont:SYSTEMFONT(14) theColor:[UIColor colorWithHexString:@"#666666"] inSuperView:self];
        middleLikeLab.attributedText = [GLGWLabel addImageName:@"home_Shape" theImageFram:CGRectMake(0, -3, kWidthProportion_In_iPhoneTriploid(14), kHeightProportion_In_iPhoneTriploid(14)) theTextString:@" 60" atImageIndex:0];
        middleLikeLab.userInteractionEnabled=YES;
        middleLikeLab.textAlignment = NSTextAlignmentCenter;
        
        rightShareLab = [[GLGWLabel alloc] initWithFrame:CGRectMake(aFrame.size.width - widthS, 0, widthS, CGRectGetHeight(leftCommentsLab.frame)) theFont:SYSTEMFONT(14) theColor:[UIColor colorWithHexString:@"#666666"] inSuperView:self];
        rightShareLab.attributedText = [GLGWLabel addImageName:@"home_Shape" theImageFram:CGRectMake(0, -3, kWidthProportion_In_iPhoneTriploid(14), kHeightProportion_In_iPhoneTriploid(14)) theTextString:@" 60" atImageIndex:0];
        rightShareLab.textAlignment = NSTextAlignmentRight;
        
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)];
        tap.numberOfTouchesRequired = 1;
        tap.numberOfTapsRequired = 1;
        tap.delegate = self;
        [middleLikeLab addGestureRecognizer:tap];

    }
    return self;
}

- (void)tapAction:(UITapGestureRecognizer *)tap
{
    if (self.Block_LikeAction) {
        self.Block_LikeAction(middleLikeLab);
    }
}

@end
